The present invention relates generally to the field of program development, and more particularly to a method for model driven development.
Model driven development (MDD) is an efficient program development mode that, for example, uses various models such as business rule model. MDD may be used to provide an abstract definition for an application or a business. For example, the model may define business rules or logic. It is known that such model may be transformed into executable program code. An MDD model may use Java code to generate a model through transforming an EMF (Eclipse Modeling Framework) model. Through use of a model and its transformation, the logic and rule of an application to be developed may be decoupled from bottom-layer program code, which is beneficial to enhance the flexibility of program development and maintenance.
After program code is generated based on the model, a developer may update the program code as required. For example, a developer may amend a part of program code, add new program code, etc. Some updates of the program code might be important and should be preserved. In other words, when the model is subject to subsequent re-transformation to generate new program code, the previous code update should be embodied in the new program code.
For an object-oriented programming language, the program code is written on the basis of methods. In this case, an annotation or keyword may be used to readily indicate a code portion that needs to be preserved. For example, in Java, an annotation “@preserve” may be used to indicate a method that needs to be preserved. Additionally, when performing a retransmission to the model, a code snippet of the method associated with “@preserve” may be preserved in the newly generated program code.
In various fields, such as, electrical power, financing, and banking, many applications are developed using non-object-oriented programming languages. For example, many applications implemented in banking are developed using COBOL, C language, or other process-oriented languages. Traditionally such programming languages cannot effectively indicate which snippets in the program code need to be preserved upon model retransformation. Therefore, some updated code snippets may be lost upon retransforming the model.